package com.andox.fn.inf.rpc.rest.proxy;

import javax.servlet.http.HttpServletRequest;

import com.andox.fn.inf.rpc.rest.RequestContext;
import com.andox.fn.inf.rpc.rest.RequestContextConstants;
import com.andox.fn.inf.rpc.rest.RpcRequest;
import com.andox.fn.inf.rpc.rest.RpcResponse;
import com.andox.fn.inf.rpc.rest.filter.Invoker;


public class RestServiceWrapper{
	private Invoker invoker;
	
	public RestServiceWrapper(Invoker invoker) {
		this.invoker = invoker;
	}
	
	public RpcResponse invoke(RpcRequest ar, HttpServletRequest httpServletRequest) {
		RequestContext.instance().putProperty(RequestContextConstants.HTTP_SERVLET_REQUEST, httpServletRequest);
		return invoker.invoke(ar);
	};
}